package com.chucang.shucang.log.controller;

import com.chucang.shucang.common.base.page.PageData;
import com.chucang.shucang.common.base.utils.R;
import com.chucang.shucang.log.service.CollectionConsignHistoryService;
import com.chucang.shucang.log.vo.CollectionConsignPageResVO;
import com.chucang.shucang.log.vo.query.CollectionConsignQuery;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 藏品寄售记录表
 *
 * @author flitsneak flitsneak@gmail.com
 * @since 1.0.0 2022-09-12
 */
@RestController
@RequestMapping("/collectionconsignhistory")
@RequiredArgsConstructor
@Api(tags = "藏品寄售记录表")
public class CollectionConsignHistoryController {

    private final CollectionConsignHistoryService collectionConsignHistoryService;

    /**
     * 寄售记录分页查询
     *
     * @param collectionConsignQuery cq
     * @return r
     */
    @PostMapping("/consignPage")
    public R<PageData<CollectionConsignPageResVO>> consignPage(@Valid @RequestBody CollectionConsignQuery collectionConsignQuery) {
        PageData<CollectionConsignPageResVO> pageData = collectionConsignHistoryService.consignPage(collectionConsignQuery);
        return R.ok(pageData);
    }
}